import { acceptHMRUpdate, defineStore } from 'pinia'

export const useStore = defineStore({
	id: 'index',
	state: () => ({
		name: 'old name',
	}),
	getters: {
		getName: (state) => {
			return state.name
		},
	},
	actions: {
		setName(name: string) {
			this.name = name
		},
	},
})
if (import.meta.hot) {
	import.meta.hot.accept(acceptHMRUpdate(useStore, import.meta.hot))
}
